home *** CD-ROM | disk | FTP | other *** search
- ;A small program to change blitz library numbers
- ;Do whatever you want with this source
-
- usagetext$="Usage: Chlibnum <library name> <library number>"
-
-
- ;check if there were any parameters passed
-
- pars.w=NumPars
-
- ;print usage info and exit
-
- If pars<2 Then NPrint usagetext$:End
-
- ;find the parameters
-
- filename$=Par$(1)
-
- libnum.w=Val(Par$(2))
-
- If filename$="?" Then NPrint usagetext$:End
-
- errortext$="Can't open file "+"'"+filename$+"'"
-
- ;try to open the library
-
- If Exists(filename$)
- If OpenFile(0,filename$)
- FileOutput 0
- FileSeek 0,37 ;jump to the right position in the file
- Print Chr$(libnum) ;print the number
- DefaultOutput
- CloseFile 0
- Else
- NPrint errortext$:End
- EndIf
- Else
- NPrint errortext$:End
- EndIf
-
- NPrint "The new library number is "+Str$(libnum)
- End
-
-